<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix ="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<jsp:include page="/jsp/part/header.jsp" />
	<title>Creation d'un nouvel achat</title>
</head>
<body>
	
	<div class="contenu">
		<jsp:include page="/jsp/part/menu.jsp" />
		<div class="container-fluid">
			<div class="row-fluid">
				<div id="left_menu" class="span3">
					<jsp:include page="/jsp/part/action_menu.jsp" />
				</div>
				<div class="span9">
					<!--  Popup -->
					<c:if test="${msg != null }" >
						<div class="alert alert-error popup_alert fade in" >
				 			<button class="close" data-dismiss="alert" >x</button>
							${msg}
						</div>
					</c:if>
					<h2>Creation d'un achat</h2>
					<form class="well form-vertical" action="/SiteERP/purchase/new" method="post">
						<div>
							Veuillez choisir le client :
							<div>
								<select name="customer">									
									<c:forEach items="${list_customers}" var="item">
										<option value='<c:out value="${item.id}"/>' ><c:out value="${item.firstName}"/> <c:out value="${item.lastName}"/></option>
									</c:forEach>
								</select>
							</div>
							
							Veuillez choisir un produit :
							<div>
								<select id="select_products">
									<c:forEach items="${list_products}" var="item">
										<option value='<c:out value="${item.id}"/>' data='<c:out value="${item.price}"/>' ><c:out value="${item.name}"/> - <c:out value="${item.price}"/> &euro;</option>
									</c:forEach>
								</select>
								<i class="icon icon-plus-sign" id="add_product"></i>
							</div>

							
							
							<fieldset>
								<legend>Vos produit command&eacute;(s)</legend>
								<div id="list_choosen_product">
									
								</div>
							</fieldset>
							Prix total : <span id="total_purchase">0</span> &euro;
						</div>
						 <button type="submit" class="btn btn-primary">Creer achat</button>
					</form>
				</div>
			</div>
		</div>
	</div>

</body>
</html>